﻿using HotelManager.Model;

namespace HotelManager.DAL
{
    public class RoomStateService : IRoomStateService
    {
        private readonly HotelDbContext _context;

        public RoomStateService(HotelDbContext context)
        {
            _context = context;
        }

        /// <summary>
        /// 获取房间状态
        /// </summary>
        /// <returns></returns>
        public List<RoomState> GetRoomState()
        {
            return _context.RoomStates.ToList();

            //string sql = "select * from RoomState";
            //SqlDataReader reader = SqlHelper.DataReader(sql);
            //List<RoomState> roomState = new List<RoomState>();
            //while (reader.Read())
            //{
            //    RoomState state = new RoomState();
            //    state.RoomStateId = Convert.ToInt32(reader["roomStateId"]);
            //    state.RoomStateName = reader["roomStateName"].ToString();
            //    roomState.Add(state);
            //}
            //reader.Close();
            //return roomState;
        }
    }
}
